package com.zjm.windows;

import javax.swing.*;
import java.awt.*;

public class LoginWindow extends JFrame {

    private JLabel usernameJLabel;
    private JLabel passwordJLable;
    private JTextField usernameTextField;
    private JTextField passwordTextField;
    private JButton loginButton;
    private JPanel jPanel;

    public LoginWindow(String title) throws HeadlessException {
        super(title);
        init();
    }

    private void init(){
        this.jPanel = new JPanel();
        this.usernameJLabel = new JLabel("用户名：");
        this.jPanel.add(this.usernameJLabel);

        this.usernameTextField = new JTextField(20);
        this.jPanel.add(this.usernameTextField);

        this.passwordJLable = new JLabel("密码：");
        this.jPanel.add(this.passwordJLable);

        this.passwordTextField = new JTextField(20);
        this.jPanel.add(this.passwordTextField);

        this.loginButton = new JButton("登录");
        this.jPanel.add(this.loginButton);


        setContentPane(this.jPanel);
    }
}